package com.evildog.workspace.life.application.convert;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.evildog.workspace.common.result.PagedResult;
import com.evildog.workspace.life.application.bo.NoteBO;
import com.evildog.workspace.life.application.bo.NoteListBO;
import com.evildog.workspace.life.application.bo.NotePageBO;
import com.evildog.workspace.life.application.dto.NoteDTO;
import com.evildog.workspace.life.application.dto.NoteListDTO;
import com.evildog.workspace.life.application.dto.NotePageDTO;
import com.evildog.workspace.life.application.entity.Note;
import com.evildog.workspace.life.application.entity.NoteListDO;
import com.evildog.workspace.life.application.entity.NotePageDO;
import com.evildog.workspace.life.application.model.NoteListParam;
import com.evildog.workspace.life.application.model.NotePageParam;
import com.evildog.workspace.life.application.model.NoteParam;
import com.evildog.workspace.life.application.vo.NoteListVO;
import com.evildog.workspace.life.application.vo.NotePageVO;
import com.evildog.workspace.life.application.vo.NoteVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface NoteConvert {

    NoteConvert INSTANCE = Mappers.getMapper(NoteConvert.class);

    NotePageDTO convert(NotePageParam notePageParam);

    NoteListDTO convert(NoteListParam noteListParam);

    NoteDTO convert(NoteParam noteParam);

    @Mapping(target = "isDeleted", ignore = true)
    Note convert(NoteDTO noteDTO);

    NotePageDO convert(NotePageDTO notePageDTO);

    NoteVO convert(NoteBO noteBO);

    NoteBO convert(Note note);

    List<NoteListBO> convert(List<NoteListDO> noteList);

    List<NoteListVO> convertVoList(List<NoteListBO> noteListBO);

    @Mappings({})
    PagedResult<NotePageBO> convert(IPage<NotePageDO> page);

    PagedResult<NotePageVO> convert(PagedResult<NotePageBO> page);
}